/*
* @Author: Marte
* @Date:   2018-11-01 10:01:26
* @Last Modified by:   Marte
* @Last Modified time: 2018-11-02 13:52:19
*/
const {Type} = require("../model/model.js");

const TypeDao = {
	save(typeinfo){
		const type = new Type(typeinfo);
		return type.save();
	},
	findByPage(page){
		const pageSize = 5;
		return Type.find({}).limit(pageSize).skip((page - 1) * pageSize);
	},
	find(condition){
		return Type.find(condition);
	},
	removeByPro(pro){
		return Type.remove(pro);
	},
	update(condition,info){
		//return Type.updateMany({department:condition},{profession:info.profession,describe:info.describe});
		return Type.update(condition,info);
	}

};
module.exports = TypeDao;